﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Default.Master" AutoEventWireup="true" CodeBehind="Home.aspx.cs" Inherits="ecommerceSample.HomePage1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<!-- JavaScripts-->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="JavaScripts/s3Slider.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $('#slider1').s3Slider({
            timeOut: 4000
        });
    });
</script>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="server"> 
<div id="super-ad">
    <div id="slider0">
        <div id="welcome">
            <asp:Label ID="Label2" runat="server" Text="Actualizando nuestra Pagina Web"></asp:Label> <br />
            <asp:Label ID="Label3" runat="server" Text="Actualizando tu vida"></asp:Label> 
            <br />
        </div>    
        <div id="main-search">
            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>  
            <asp:Button ID="Button1" runat="server" Text="Buscar" onclick="Button1_Click" />
            <br />   
        </div>
    </div>
    <div id="slider1">
        <ul id="slider1Content">
            <li class="slider1Image">
                <a href=""><img src="Images/Ads/nixon-headphones.jpg" alt="1" width="384px" height="200px"/></a>
                <span class="left"><strong>NIXON</strong><br />Headphones</span></li>
            <li class="slider1Image">
                <a href=""><img src="Images/Ads/nixon-watch-advertising.jpg" alt="1" width="384px" height="200px"/></a>
                <span class="left"><strong>NIXON</strong><br />Watch</span></li>
            <li class="slider1Image">
                <a href=""><img src="Images/Ads/nixon-watch-advertising2.jpg" alt="1" width="384px" height="200px"/></a>
                <span class="left"><strong>NIXON</strong><br />Watch</span></li>
            <li class="slider1Image">
                <a href=""><img src="Images/Ads/nixon-watch-advertising3.jpg" alt="1" width="384px" height="200px"/></a>
                <span class="left"><strong>NIXON</strong><br />Watch</span></li>
            <div class="clear slider1Image"></div>
        </ul>
    </div>
</div>
    
</asp:Content>
              
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> 
                <asp:SqlDataSource ID="SqlDataSource2" runat="server"
                    ConnectionString="<%$ ConnectionStrings:ecommerceSample %>" 
                    ProviderName="<%$ ConnectionStrings:ecommerceSample.ProviderName %>"             
                    SelectCommand="SELECT * FROM Articles INNER JOIN Categories ON Articles.CategoryId = Categories.CategoryId INNER JOIN aspnet_Users ON Articles.UserId = aspnet_Users.UserId ORDER BY Date DESC ">
                </asp:SqlDataSource>   
                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                    DataKeyNames="ArticleId" DataSourceID="SqlDataSource2" PageSize="5" BorderWidth="0px" >
                    <Columns>
                        <asp:TemplateField ItemStyle-BorderWidth="0px" 
                            HeaderText="Últimos Artículos"
                            HeaderStyle-CssClass="template-title">
                            <ItemTemplate>
                            <asp:Table ID="Table1" runat="server">
                                    <asp:TableRow ID="TableRow1" runat="server">
                                        <asp:TableCell ID="TableCell1" runat="server" >
                                             <a href="/User/Article.aspx?id=<%# Eval("ArticleId") %>"><img alt="<%# Eval("Title") %>" class="small-images"  src="<%# Eval("Image") %>" width="120px"/></a>
                                        </asp:TableCell>
                                        <asp:TableCell ID="TableCell2" runat="server" CssClass="text-content">                                            
                                            <hr />
                                            <div class="article-grey"><a href="/Category.aspx?id=<%# Eval("CategoryId") %>"><%# Eval("Name") %></a><small>: <%# Eval("Date") %></small></div>
                                                <b>
                                                <div class="article-title"><big><a href="/User/Article.aspx?id=<%# Eval("ArticleId") %>"><%# Eval("Title") %></a></big></div>
                                                </b>
                                            <small>
                                                <div class="article-grey">Posteado por: <big><a href="/User/User.aspx?id=<%# Eval("UserId") %>"><%# Eval("UserName") %></a></big></div>
                                                <%# LimitWords(Eval("Text").ToString(),50)%>                                            
                                                <a href="User/Article.aspx?id=<%# Eval("ArticleId") %>"><br />
                                                <div class="read-more"><i>leer más</i></a></div>
                                            </small>
                                        </asp:TableCell>
                                    </asp:TableRow>
                                </asp:Table>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle"/>
                    <PagerStyle HorizontalAlign="Center" VerticalAlign="Top" BorderColor="White"/>
                </asp:GridView>     
</asp:Content>
